\hypertarget{execution_8c}{
\section{/home/noxon/coding/C/esiee-in301/src/execution.c File Reference}
\label{execution_8c}\index{/home/noxon/coding/C/esiee-in301/src/execution.c@{/home/noxon/coding/C/esiee-in301/src/execution.c}}
}
{\tt \#include \char`\"{}execution.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{execution_8c_7c54ebca983c4571f0f2017f17d50cd0}{launch\_\-execution} (\hyperlink{structmodule__struct}{module} $\ast$mdl, const int port)
\item 
\hyperlink{structmsg__struct}{msg} $\ast$ \hyperlink{execution_8c_bd09a3b28b0ec5772ac099ed5adb9351}{execution\_\-msg} (\hyperlink{structmsg__struct}{msg} $\ast$mess, int $\ast$stock\_\-restant, \hyperlink{structaction}{action} $\ast$act, int nombre\_\-actions)
\item 
\hyperlink{structmsg__struct}{msg} $\ast$ \hyperlink{execution_8c_d65512a98d447b4e5290ccc889947df3}{execution} (char $\ast$emetteur, char $\ast$type\_\-transaction, char $\ast$id\_\-action\_\-ordre, char $\ast$quantite\_\-ordre, int $\ast$stock\_\-restant\_\-p, \hyperlink{structaction}{action} $\ast$act\_\-p, int nombre\_\-actions)
\end{CompactItemize}


\subsection{Function Documentation}
\hypertarget{execution_8c_d65512a98d447b4e5290ccc889947df3}{
\index{execution.c@{execution.c}!execution@{execution}}
\index{execution@{execution}!execution.c@{execution.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf msg}$\ast$ execution (char $\ast$ {\em emetteur}, \/  char $\ast$ {\em type\_\-transaction}, \/  char $\ast$ {\em id\_\-action\_\-ordre}, \/  char $\ast$ {\em quantite\_\-ordre}, \/  int $\ast$ {\em stock\_\-restant}, \/  {\bf action} $\ast$ {\em act}, \/  int {\em nombre\_\-actions})}}
\label{execution_8c_d65512a98d447b4e5290ccc889947df3}


Permet de traiter un message reçu. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em emetteur}]émetteur du message \item[{\em type\_\-transaction}]type du message \item[{\em id\_\-action\_\-ordre}]identificateur de l'action \item[{\em quantite\_\-ordre}]valeur associée au message \item[{\em stock\_\-restant}]le stock restant pour l'action concernée \item[{\em act}]l'action concernée par l'ordre \item[{\em nombre\_\-actions}]nombre total d'actions pour cette action-ci \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]l'accusé de réception \end{Desc}


Definition at line 146 of file execution.c.

References create\_\-msg(), action::id, log\_\-msg(), log\_\-smth(), PrixAchat(), PrixVente(), action::stock, and action::val.

Referenced by execution\_\-msg().\hypertarget{execution_8c_bd09a3b28b0ec5772ac099ed5adb9351}{
\index{execution.c@{execution.c}!execution\_\-msg@{execution\_\-msg}}
\index{execution\_\-msg@{execution\_\-msg}!execution.c@{execution.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf msg}$\ast$ execution\_\-msg ({\bf msg} $\ast$ {\em mess}, \/  int $\ast$ {\em stock\_\-restant}, \/  {\bf action} $\ast$ {\em act}, \/  int {\em nombre\_\-actions})}}
\label{execution_8c_bd09a3b28b0ec5772ac099ed5adb9351}


Permet de traiter un message reçu. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mess}]le message sous forme msg \item[{\em stock\_\-restant}]le stock restant pour l'action concernée \item[{\em act}]l'action concernée par l'ordre \item[{\em nombre\_\-actions}]nombre total d'actions pour cette action-ci \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]l'accusé de réception \end{Desc}


Definition at line 140 of file execution.c.

References msg\_\-struct::action, msg\_\-struct::emetteur, execution(), msg\_\-struct::type, and msg\_\-struct::valeur.

Referenced by launch\_\-execution().\hypertarget{execution_8c_7c54ebca983c4571f0f2017f17d50cd0}{
\index{execution.c@{execution.c}!launch\_\-execution@{launch\_\-execution}}
\index{launch\_\-execution@{launch\_\-execution}!execution.c@{execution.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void launch\_\-execution ({\bf module} $\ast$ {\em mdl}, \/  const int {\em port})}}
\label{execution_8c_7c54ebca983c4571f0f2017f17d50cd0}


Permet de démarrer un serveur d'exécution \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mdl}]module lié au serveur d'exécution \item[{\em port}]port sur lequel le serveur se bind \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void: le serveur est forké.\end{Desc}
\par
{\bf Exemple d'utilisation:} \small\begin{alltt} module *exect1=init\_module("Exécution 01", exec, 1);
 launch\_execution(exect1, 1202);\end{alltt}
\normalsize 
 

Definition at line 3 of file execution.c.

References msg\_\-struct::action, module\_\-struct::bourse\_\-id, execution\_\-msg(), action::id, server\_\-struct::isAlive, server\_\-struct::local\_\-addr, log\_\-msg\_\-srv(), log\_\-smth(), log\_\-srv(), MAXRECVDATA, msg\_\-to\_\-str(), module\_\-struct::name, server\_\-struct::name, server\_\-struct::numbytes, server\_\-struct::recvdata, server\_\-struct::remote\_\-addr, server\_\-struct::sin\_\-size, server\_\-struct::sockfd, module\_\-struct::srv, action::stock, str\_\-to\_\-msg(), and action::val.

Referenced by main().